fix: prevent check/uncheck from hanging on hidden checkbox elements#388
fix: prevent check/uncheck from hanging on hidden checkbox elements#388liuxiaopai-ai wants to merge 1 commit intovercel-labs:mainfrom
Conversation
|
@liuxiaopai-ai is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 468f2807e9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| message.includes('Timeout') || | ||
| message.includes('waiting for') || |
There was a problem hiding this comment.
Restrict forced retry to explicit visibility failures
This retry condition treats any error containing Timeout or waiting for as a hidden-element case, so safeCheckAction will force a second check/uncheck even when the first failure was due to other actionability problems (for example, an overlay intercepting pointer events or a control still disabled). In those cases the forced retry bypasses normal actionability checks and can report success instead of surfacing the real blocked-state error, which changes command semantics and can mask real UI issues. Please narrow the fallback trigger to explicit visibility/hidden signals rather than generic timeout text.
Useful? React with 👍 / 👎.
Summary
Fixes #335
When using UI component libraries like Element UI, Ant Design, or Vuetify, native checkbox
<input>elements are typically hidden (display: none,opacity: 0, orvisibility: hidden) while a styled wrapper/label is shown instead. Thecheckanduncheckcommands directly operate on the native checkbox via Playwright'slocator.check()/locator.uncheck(), which waits for the element to become visible — causing an indefinite hang.Changes
safeCheckAction()helper that first attemptscheck()/uncheck()with a 5-second timeout{ force: true }to bypass the visibility checkhandleCheck,handleUncheck,handleGetByRole,handleGetByLabel,handleFilter, andhandleNthHow It Works
This ensures:
force: true